package com.example.administrator.yuejian23.Activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Administrator on 2017/9/25.
 */

public abstract class BaseActivity extends AppCompatActivity {
    //定于共享的变量
    protected static String userId;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    public static String getUserId() {
        return userId;
    }

    public static void setUserId(String uid) {
        userId = uid;
    }

    public static boolean checkName(String telephone) {
        String regexp = "1(3[0-9]|47|5((?!4)[0-9])|7(0|1|[6-8])|8[0-9])\\d{8,8}";
        Pattern p = Pattern.compile(regexp);
        Matcher matcher = p.matcher(telephone);
        return matcher.matches();
    }
}
